<?php if(!empty($products)) { ?>
<div class="box">
    <div class="grid">
        <div class="row">
            <h3 class="grid_title"><?php echo $category; ?></h3>
        <?php foreach($products as $key => $value){
            if(SLUG_ACTIVE==0){
                $uri = get_base_url() . url_title(trim($value->product_name), 'dash', TRUE) . '-ps' . $value->id;
            }else{
                $uri = get_base_url() . $value->slug;
            }
            $image = is_null($value->image_name) ? base_url().'images/no-image.png' : base_url().'images/products/thumbnails/'.$value->image_name;
            $value_name = limit_text($value->product_name, 50);
            $value_category = limit_text($value->category, 100);
            $price = $value->price != 0 ? get_price_in_vnd($value->price) . ' ₫' : get_price_in_vnd($value->price);           
        ?>
        <div class="col-sm-6 item item_products">
            <div class="item-image">
                <a title="<?php echo $value->product_name; ?>" href="<?php echo $uri; ?>">
                    <img alt="" title="<?php echo $value->product_name; ?>" src="<?php echo $image; ?>" />
                </a>
            </div>
            <span class="category"><?php echo $value_category; ?></span>
            <span class="item-comments">
                <a title="Bình luận bài <?php echo $value->product_name; ?>" href="<?php echo $uri; ?>#comments">
                    <span class="fb_comments_count"><?php echo $value->viewed; ?></span> Lượt xem
                </a>
            </span>
            <h3><a title="<?php echo $value->product_name; ?>" href="<?php echo $uri; ?>"><?php echo $value_name; ?></a></h3>
            <h4><?php echo $price; ?></h4>
        </div>
        <?php } ?>
        </div>
    </div>
    <div class="paging">
        <?php echo $this->pagination->create_links(); ?>
    </div>
</div>
<?php }else { ?>
<h4 class="alert alert-warning"><?php echo __('IP_tags_no_result'); ?></h4>
<?php } ?>